package com.pk4pk.imagecycleview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.pk4pk.imagecycleviewlib.ADInfo;
import com.pk4pk.imagecycleviewlib.ImageCycleView;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {
    private ImageCycleView imageCycleView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        imageCycleView= (ImageCycleView) findViewById(R.id.image_cycle_view);
    }


    /**
     * 获取广告栏信息
     */
    private void getBanners() {
//                    if (entity != null && 0 == entity.getError_code()) {
//                        ArrayList<ADInfo> adDatas = new ArrayList<>();//广告信息
//                        for (int i = 0; i < entity.getData().getList().size(); i++) {
//                            ADInfo info = new ADInfo();
//                            info.setUrl(entity.getData().getList().get(i).getImage());
//                            info.setContent(entity.getData().getList().get(i).getApp_route());//跳转规则
//                            adDatas.add(info);
//                        }
//
//                        ad_view.setImageResources(adDatas, mAdCycleViewListener);
//                        ad_view.startImageCycle();//启动广告轮播动画
//
//                    }


    }


    //广告栏图片加载和点击事件
    private ImageCycleView.ImageCycleViewListener mAdCycleViewListener = new ImageCycleView.ImageCycleViewListener() {

        @Override
        public void onImageClick(ADInfo info, int position, View imageView) {

        }

        @Override
        public void displayImage(String imageURL, ImageView imageView) {
//            BuYao_ImgHandlerUtil.setImgView(imageURL, imageView);
        }
    };
}
